package com.ruoyi.express.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.express.mapper.AppExpressDeliveryMapper;
import com.ruoyi.express.domain.AppExpressDelivery;
import com.ruoyi.express.service.IAppExpressDeliveryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 快递单据Service业务层处理
 * 
 * @author ruoyi
 * @date 2019-12-03
 */
@Service
public class AppExpressDeliveryServiceImpl implements IAppExpressDeliveryService 
{
    @Autowired
    private AppExpressDeliveryMapper appExpressDeliveryMapper;

    /**
     * 查询快递单据
     * 
     * @param id 快递单据ID
     * @return 快递单据
     */
    @Override
    public AppExpressDelivery selectAppExpressDeliveryById(Long id)
    {
        return appExpressDeliveryMapper.selectAppExpressDeliveryById(id);
    }

    /**
     * 查询快递单据列表
     * 
     * @param appExpressDelivery 快递单据
     * @return 快递单据
     */
    @Override
    public List<AppExpressDelivery> selectAppExpressDeliveryList(AppExpressDelivery appExpressDelivery)
    {
        return appExpressDeliveryMapper.selectAppExpressDeliveryList(appExpressDelivery);
    }

    /**
     * 新增快递单据
     * 
     * @param appExpressDelivery 快递单据
     * @return 结果
     */
    @Override
    public int insertAppExpressDelivery(AppExpressDelivery appExpressDelivery)
    {
        appExpressDelivery.setCreateTime(DateUtils.getNowDate());
        return appExpressDeliveryMapper.insertAppExpressDelivery(appExpressDelivery);
    }

    /**
     * 修改快递单据
     * 
     * @param appExpressDelivery 快递单据
     * @return 结果
     */
    @Override
    public int updateAppExpressDelivery(AppExpressDelivery appExpressDelivery)
    {
        return appExpressDeliveryMapper.updateAppExpressDelivery(appExpressDelivery);
    }

    /**
     * 删除快递单据对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAppExpressDeliveryByIds(String ids)
    {
        return appExpressDeliveryMapper.deleteAppExpressDeliveryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除快递单据信息
     * 
     * @param id 快递单据ID
     * @return 结果
     */
    @Override
    public int deleteAppExpressDeliveryById(Long id)
    {
        return appExpressDeliveryMapper.deleteAppExpressDeliveryById(id);
    }
}
